import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { UploadTypeEnum } from '/@/components/Form/src/jeecg/components/JUpload';
import { render } from '/@/utils/common/renderUtils';
import { defHttp } from '/@/utils/http/axios';
//列表数据
export const columns : BasicColumn[] = [
	{
		title: '每人价格',
		align: "center",
		sorter: true,
		dataIndex: 'everyonePrice'
	},
	{
		title: '已选车型',
		align: "center",
		dataIndex: 'carId_dictText'
	},
	{
		title: '绑定车辆',
		align: "center",
		dataIndex: 'noundVehicleId_dictText'
	},
	{
		title: '行程',
		align: "center",
		dataIndex: 'mainId_dictText'
	},
	/* 	{
			title: '景点',
			align: "center",
			dataIndex: 'scenicSpotId_dictText'
		}, */
	{
		title: '几天',
		align: "center",
		dataIndex: 'severalDays'
	},
	{
		title: '类型',
		align: "center",
		dataIndex: 'carpoolType_dictText'
	},
	{
		title: '可坐游客数',
		align: "center",
		dataIndex: 'totalPeopleNum'
	},
	{
		title: '已报名人数',
		align: "center",
		dataIndex: 'numberOfRegistered'
	},
	{
		title: '拼包车编号',
		align: "center",
		dataIndex: 'carpoolNumber'
	},
	{
		title: '限制报名人性别',
		align: "center",
		dataIndex: 'restrictedSex_dictText'
	},
	{
		title: '出发城市',
		align: "center",
		dataIndex: 'departureCity_dictText'
	},
	{
		title: '出发时间',
		align: "center",
		dataIndex: 'departureTime'
	},
	{
		title: '上车地点',
		align: "center",
		dataIndex: 'pickUpPoint_dictText'
	},
	/* {
	 title: '包车价',
	 align:"center",
	 dataIndex: 'charterPrice'
	}, */
	{
		title: '状态',
		align: "center",
		dataIndex: 'statusCarpool_dictText'
	},
	{
		title: '失败原因',
		align: "center",
		dataIndex: 'cancelCause_dictText'
	},
	{
		title: '发起人',
		align: "center",
		dataIndex: 'userId_dictText',
		customRender: ({ record, column }) => {
			return record ? record.userId : record
		}
	},
];

export const carpoolBusGradienColumns : BasicColumn[] = [
	{
		title: '每人支付',
		align: "center",
		sorter: true,
		dataIndex: 'everyonePrice'
	},
	{
		title: '总价格',
		align: "center",
		sorter: true,
		dataIndex: 'totalCharterPrice'
	},
	{
		title: '已选车型',
		align: "center",
		dataIndex: 'carId_dictText'
	},
	{
		title: '绑定车辆',
		align: "center",
		dataIndex: 'noundVehicleId_dictText'
	},
	{
		title: '行程',
		align: "center",
		dataIndex: 'mainId_dictText'
	},
	/* 	{
			title: '景点',
			align: "center",
			dataIndex: 'scenicSpotId_dictText'
		}, */
	{
		title: '几天',
		align: "center",
		dataIndex: 'severalDays'
	},
	{
		title: '类型',
		align: "center",
		dataIndex: 'carpoolType_dictText'
	},
	{
		title: '可坐游客数',
		align: "center",
		dataIndex: 'totalPeopleNum'
	},
	{
		title: '出行人数',
		align: "center",
		dataIndex: 'numberOfRegistered'
	},
	{
		title: '拼包车编号',
		align: "center",
		dataIndex: 'carpoolNumber'
	},
	{
		title: '限制报名人性别',
		align: "center",
		dataIndex: 'restrictedSex_dictText'
	},
	{
		title: '出发城市',
		align: "center",
		dataIndex: 'departureCity_dictText'
	},
	{
		title: '出发时间',
		align: "center",
		dataIndex: 'departureTime'
	},
	{
		title: '上车地点',
		align: "center",
		dataIndex: 'pickUpPoint_dictText'
	},
	/* {
	 title: '包车价',
	 align:"center",
	 dataIndex: 'charterPrice'
	}, */
	{
		title: '状态',
		align: "center",
		dataIndex: 'statusCarpool_dictText'
	},
	{
		title: '失败原因',
		align: "center",
		dataIndex: 'cancelCause_dictText'
	},
	{
		title: '发起人',
		align: "center",
		dataIndex: 'userId_dictText',
		customRender: ({ record, column }) => {
			return record ? record.userId : record
		}
	},
];

//查询数据
export const searchFormSchema : FormSchema[] = [
	/* 	{
			label: "车",
			field: "carId",
			component: 'JSearchSelect',
			componentProps: {
				dict: "couple_activity_car,plate_number,id"
			},
			//colProps: {span: 6},
		}, */
	{
		label: '车型选择',
		field: 'carId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "motorcycle_type"
		},
		/* componentProps: ({ formActionType }) => {
			const { setFieldsValue } = formActionType;
			return {
				setFieldsValue: setFieldsValue,
				code: "scenic_spot_select_car_model",
				fieldConfig: [
					{ source: 'id', target: 'carId' },
				],
				multi: true
			}
		}, */
	},
	{
		label: "活动",
		field: "mainId",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
		//colProps: {span: 6},
	},
	/* 	{
			label: "景点",
			field: "scenicSpotId",
			component: 'JSearchSelect',
			componentProps: {
				dict: "couple_shop,title,id,shop_category=1"
			},
		}, */
	{
		label: "类型",
		field: "carpoolType",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "carpool_type"
		},
		//colProps: {span: 6},
	},
	/* {
	  label: "拼包车编号",
	  field: "carpoolNumber",
	  component: 'Input',
	  //colProps: {span: 6},
	  }, */
	{
		label: "限制报名人性别",
		field: "restrictedSex",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "sex"
		},
		//colProps: {span: 6},
	},
	{
		label: "出发城市",
		field: "departureCity",
		component: 'Input',
		//colProps: {span: 6},
	},
	{
		label: "上车地点",
		field: "pickUpPoint",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_pick_up_point,address,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "状态",
		field: "statusCarpool",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "status_carpool"
		},
		//colProps: {span: 6},
	},
	{
		label: "发起人",
		field: "userId",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_user,user_name,id"
		},
		//colProps: {span: 6},
	},
];
//表单数据
export const formSchema : FormSchema[] = [
	{
		label: '每人价格',
		field: 'everyonePrice',
		component: 'InputNumber',
	},
	/* 	{
			label: '车',
			field: 'carId',
			component: 'JSearchSelect',
			componentProps: {
				dict: "couple_activity_car,plate_number,id"
			},
		}, */



	{
		label: '车型选择',
		field: 'carId',
		//component: 'JPopup',
		component: 'JSelectMultiple',
		componentProps: {
			dictCode: "motorcycle_type"
		},
		/* componentProps: ({ formActionType }) => {
			const { setFieldsValue } = formActionType;
			return {
				setFieldsValue: setFieldsValue,
				code: "scenic_spot_select_car_model",
				fieldConfig: [
					{ source: 'id', target: 'carId' },
				],
				multi: true
			}
		},
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请安排车辆!' }];
		}, */
	},
	{
		label: '图片展示',
		field: 'imgs',
		component: 'JUpload',
		helpMessage: '最多上传20张图片',
		componentProps: {
			fileType: UploadTypeEnum.image,
			maxCount: 20,
		}

	},
	{
		label: '行程',
		field: 'mainId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请选择活动行程!' }];
		},
	},

	/* {
		label: '景点',
		field: 'scenicSpotId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_shop,title,id"
		},
	}, */
	{
		label: '几天',
		field: 'severalDays',
		component: 'InputNumber',
	},
	{
		label: '出发时间',
		field: 'departureTime',
		component: 'DatePicker',
		componentProps: {
			showTime: true,
			valueFormat: 'YYYY-MM-DD HH:mm:ss'
		},
	},
	{
		label: '类型',
		field: 'carpoolType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "carpool_type"
		},
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请选择类型!' }];
		},
	},
	/* {
		label: "状态",
		field: "statusCarpool",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "status_carpool"
		},
		//colProps: {span: 6},
	}, */
	{
		label: '可坐游客数',
		field: 'totalPeopleNum',
		component: 'InputNumber',
	},
	{
		label: '已报名人数',
		field: 'numberOfRegistered',
		component: 'InputNumber',
	},
	/* {
		label: '拼包车编号',
		field: 'carpoolNumber',
		component: 'Input',
	}, */
	{
		label: '限制报名人性别',
		field: 'restrictedSex',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "sex"
		},
	},
	/* 	{
			label: '出发城市',
			field: 'departureCity',
			component: 'Input',
		}, */
	{
		label: '出发城市',
		field: 'departureCity',
		component: 'JTreeDict',
		componentProps: { async: true, parentCode: 'A02' },
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请选择城市!' }];
		},
	},
	{
		label: '上车地点',
		field: 'pickUpPoint',
		component: 'JSelectMultiple',
		componentProps: {
			dictCode: "couple_pick_up_point,address,id"
		},
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请选择上车地点!' }];
		},
	},
	/*{
		label: '包车价',
		field: 'charterPrice',
		component: 'InputNumber',
	},
	  {
		label: '状态',
		field: 'statusCarpool',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "status_carpool"
		},
	}, */
	/* 	{
			label: '发起人',
			field: 'userId',
			component: 'JSearchSelect',
			componentProps: {
				dict: "couple_user,user_name,id"
			},
		}, */
	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];
//表单数据
export const formCarpoolCharteredBusSchema : FormSchema[] = [
	{
		label: '包车总价格',
		field: 'totalCharterPrice',
		component: 'InputNumber',
	},
	{
		label: '每人支付',
		field: 'everyonePrice',
		component: 'InputNumber',
	},
	/* 	{
			label: '车',
			field: 'carId',
			component: 'JSearchSelect',
			componentProps: {
				dict: "couple_activity_car,plate_number,id"
			},
		}, */



	{
		label: '车型选择',
		field: 'carId',
		//component: 'JPopup',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "motorcycle_type"
		},
		/* componentProps: ({ formActionType }) => {
			const { setFieldsValue } = formActionType;
			return {
				setFieldsValue: setFieldsValue,
				code: "scenic_spot_select_car_model",
				fieldConfig: [
					{ source: 'id', target: 'carId' },
				],
				multi: true
			}
		},
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请安排车辆!' }];
		}, */
	},
	{
		label: '图片展示',
		field: 'imgs',
		component: 'JUpload',
		helpMessage: '最多上传20张图片',
		componentProps: {
			fileType: UploadTypeEnum.image,
			maxCount: 20,
		}

	},
	{
		label: '活动景点行程',
		field: 'mainId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请选择活动景点行程!' }];
		},
	},

	/* {
		label: '景点',
		field: 'scenicSpotId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_shop,title,id"
		},
	}, */
	{
		label: '几天',
		field: 'severalDays',
		component: 'InputNumber',
	},
	{
		label: '出发时间',
		field: 'departureTime',
		component: 'DatePicker',
		componentProps: {
			showTime: true,
			valueFormat: 'YYYY-MM-DD HH:mm:ss'
		},
	},
	{
		label: '类型',
		field: 'carpoolType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "carpool_type"
		},
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请选择类型!' }];
		},
	},
	/* {
		label: "状态",
		field: "statusCarpool",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "status_carpool"
		},
		//colProps: {span: 6},
	}, */
	{
		label: '可坐游客数',
		field: 'totalPeopleNum',
		component: 'InputNumber',
	},
	{
		label: '出行人数',
		field: 'numberOfRegistered',
		component: 'InputNumber',
	},
	/* {
		label: '拼包车编号',
		field: 'carpoolNumber',
		component: 'Input',
	}, */
	/* {
		label: '限制报名人性别',
		field: 'restrictedSex',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "sex"
		},
	}, */
	/* 	{
			label: '出发城市',
			field: 'departureCity',
			component: 'Input',
		}, */
	{
		label: '出发城市',
		field: 'departureCity',
		component: 'JTreeDict',
		componentProps: { async: true, parentCode: 'A02' },
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请选择城市!' }];
		},
	},
	{
		label: '上车地点',
		field: 'pickUpPoint',
		component: 'JSelectMultiple',
		componentProps: {
			dictCode: "couple_pick_up_point,address,id"
		},
		dynamicRules: ({ model, schema }) => {
			return [{ required: true, message: '请选择上车地点!' }];
		},
	},
	/*{
		label: '包车价',
		field: 'charterPrice',
		component: 'InputNumber',
	},
	  {
		label: '状态',
		field: 'statusCarpool',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "status_carpool"
		},
	}, */
	/* 	{
			label: '发起人',
			field: 'userId',
			component: 'JSearchSelect',
			componentProps: {
				dict: "couple_user,user_name,id"
			},
		}, */
	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];

//子表列表数据
export const coupleActivityScenicSpotConnectionColumns : BasicColumn[] = [
	/* {
		title: '活动',
		align: "center",
		dataIndex: 'mainId_dictText'
	}, */
	{
		title: '第几天',
		align: "center",
		sorter: true,
		dataIndex: 'whichDay'
	},
	{
		title: '景点',
		align: "center",
		dataIndex: 'scenicSpots_dictText'
	},
	{
		title: '房间价格',
		align: "center",
		dataIndex: 'priceDay'
	},
	{
		title: '几个房间',
		align: "center",
		dataIndex: 'roomNum'
	},
	{
		title: '总价',
		align: "center",
		dataIndex: 'priceTotal'
	},
	{
		title: '选择人',
		align: "center",
		dataIndex: 'userId_dictText',
		customRender: ({ record, column }) => {
			return record ? record.userId : record
		}
	},
];
//子表表单数据
export const coupleActivityScenicSpotConnectionFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
	/* {
		label: '活动',
		field: 'mainId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
	}, */
	{
		label: '第几天',
		field: 'whichDay',
		component: 'InputNumber',
		required: true
	},
	/* {
		label: '景点',
		field: 'scenicSpots',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_shop,title,id"
		},
	}, */
	{
		label: '景点选择',
		field: 'scenicSpots',
		component: 'JPopup',
		componentProps: ({ formActionType }) => {
			const { setFieldsValue } = formActionType;
			return {
				setFieldsValue: setFieldsValue,
				code: "select_scenic_spot",
				fieldConfig: [
					{ source: 'id', target: 'scenicSpots' },
				],
				multi: true
			}
		},
		required: true
	},
	{
		label: '酒店',
		field: 'shopId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_shop,title,id,shop_category=5"
		},
	},
	{
		label: '房间价格',
		field: 'priceDay',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!' },
			];
		},
	},
	{
		label: '几个房间',
		field: 'roomNum',
		component: 'InputNumber',
	},
	{
		label: '当晚酒店总价',
		field: 'priceTotal',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!' },
			];
		},
	},
	/* 	{
			label: '选择人',
			field: 'userId',
			component: 'JSearchSelect',
			componentProps: {
				dict: "couple_user,user_name,id"
			},
		}, */
];

//子表列表数据
export const coupleActivityOrderColumns : BasicColumn[] = [
	{
		title: '用户',
		align: "center",
		dataIndex: 'userId_dictText'
	},
	{
		title: '是否发起人',
		align: "center",
		dataIndex: 'isSponsor_dictText'
	},
	{
		title: '活动',
		align: "center",
		dataIndex: 'mainId_dictText'
	},
	{
		title: '拼包车id',
		align: "center",
		dataIndex: 'carpoolBus_dictText'
	},
	/* {
		title: '拼包车类别',
		align: "center",
		dataIndex: 'carpoolType_dictText'
	}, */
	{
		title: '订单编号',
		align: "center",
		dataIndex: 'orderNo'
	},
	{
		title: '订单状态',
		align: "center",
		dataIndex: 'orderStatus_dictText'
	},
	{
		title: '报名人数',
		align: "center",
		sorter: true,
		dataIndex: 'registrationPopulation'
	},
	/* 	{
			title: '转出转入',
			align: "center",
			dataIndex: 'rollOrIn_dictText'
		}, */
	/* {
		title: '转出到商家',
		align: "center",
		dataIndex: 'rollOutShopId_dictText'
	}, */
	{
		title: '商家转入',
		align: "center",
		dataIndex: 'rollInShopId_dictText'
	},
	{
		title: '拼包车编号',
		align: "center",
		dataIndex: 'carpoolBusNo'
	},
	{
		title: '支付方式',
		align: "center",
		dataIndex: 'payType_dictText'
	},
	{
		title: '支付单号',
		align: "center",
		dataIndex: 'payNo'
	},
	{
		title: '待收款',
		align: "center",
		sorter: true,
		dataIndex: 'unpaidPrice'
	},
	{
		title: '订单金额',
		align: "center",
		sorter: true,
		dataIndex: 'payPrice'
	},
	{
		title: '结算价',
		align: "center",
		sorter: true,
		dataIndex: 'settlementPrice'
	},

];
//子表表单数据
export const coupleActivityOrderFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
	{
		label: '用户',
		field: 'userId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_user,user_name,id"
		},
	},
	{
		label: '是否发起人',
		field: 'isSponsor',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "is"
		},
	},
	{
		label: '活动',
		field: 'mainId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
	},
	{
		label: '拼包车id',
		field: 'carpoolBus',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_carpool_bus,carpool_number,id"
		},
	},
	{
		label: '拼包车类别',
		field: 'carpoolType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "carpool_type"
		},
	},
	{
		label: '订单状态',
		field: 'orderStatus',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "order_status"
		},
	},
	{
		label: '报名人数',
		field: 'registrationPopulation',
		component: 'InputNumber',
	},
	{
		label: '转出转入',
		field: 'rollOrIn',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "rool_or_in"
		},
	},
	{
		label: '转出到旅行社',
		field: 'rollOutShopId',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "couple_shop,title,id,shop_category=2"
		},
	},
	{
		label: '从旅行社转入',
		field: 'rollInShopId',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "couple_shop,title,id,shop_category=2"
		},
	},
	{
		label: '订单编号',
		field: 'orderNo',
		component: 'Input',
	},
	{
		label: '拼包车编号',
		field: 'carpoolBusNo',
		component: 'Input',
	},
	{
		label: '支付方式',
		field: 'payType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: ""
		},
	},
	{
		label: '支付单号',
		field: 'payNo',
		component: 'Input',
	},
	{
		label: '支付金额',
		field: 'payPrice',
		component: 'InputNumber',
	},

];
//子表表单数据
export const coupleActivityOrderFbFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
	/* 	{
			label: '用户',
			field: 'userId',
			component: 'JSearchSelect',
			componentProps: {
				dict: "couple_user,user_name,id"
			},
		}, */
	{
		label: '粘贴识别',
		field: 'userInfo',
		component: 'JSearchSelect',
		slot: 'userInfo'
	},

	/* 	{
			label: '粘贴识别',
			field: 'searchBox',
			component: 'InputSearch',
			componentProps: {
				//搜索之后触发事件
				onSearch: (value : any) => {
					//搜索之后的逻辑处理
					console.log(value)
					
				}
			}
		}, */

	{
		label: '是否外国人',
		field: 'isForeigner',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "is"
		},
	},
	{
		label: '姓名',
		field: 'userName',
		component: 'Input',
		componentProps: ({ formActionType, formModel }) => {
			console.log(formModel, formActionType)
			return {
				disabled: formModel.isUpdate
			}
		}
	},
	{
		label: '电话',
		field: 'userPhone',
		component: 'InputNumber',
		componentProps: ({ formActionType, formModel }) => {
			console.log(formModel, formActionType)
			return {
				disabled: formModel.isUpdate
			}
		}
	},

	{
		label: '身份证/护照',
		field: 'userCard',
		component: 'Input',
		componentProps: ({ formActionType, formModel }) => {
			console.log(formModel, formActionType)
			return {
				disabled: formModel.isUpdate
			}
		}
	},
	{
		label: '',
		field: 'isUpdate',
		ifShow: false,
		component: 'InputNumber',
	},
	{
		label: '生日',
		field: 'birthday',
		component: 'DatePicker',

	},
	{
		label: '是否发起人',
		field: 'isSponsor',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "is"
		},
	},
	{
		label: '是否发合同',
		field: 'isContrant',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "is"
		},
	},
	/*{
		label: '活动',
		field: 'mainId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
	},
	 {
	  label: '拼包车id',
	  field: 'carpoolBus',
	  component: 'JSearchSelect',
	  componentProps:{
		 dict:"couple_activity_carpool_bus,carpool_number,id"
	  },
	}, */
	/* {
	  label: '拼包车类别',
	  field: 'carpoolType',
	  component: 'JDictSelectTag',
	  componentProps:{
		  dictCode:"carpool_type"
	   },
	}, */
	{
		label: '订单状态',
		field: 'orderStatus',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "order_status"
		},
	},
	/* {
		label: '报名人数',
		field: 'registrationPopulation',
		component: 'InputNumber',
	},
	{
		label: '转出转入',
		field: 'rollOrIn',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "rool_or_in"
		},
	},
	{
		label: '转出到商家',
		field: 'rollOutShopId',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: ""
		},
	}, */
	{
		label: '旅行社转入',
		field: 'rollInShopId',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "couple_shop,title,id,shop_category=2"
		},
	},
	{
		label: '合同',
		field: 'contractId',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "content,title,id,type_id='1724577331177107457'"
		},
		ifShow: ({ values }) => {
			return values.isContrant == '1'
		}
	},
	/*{
		label: '订单编号',
		field: 'orderNo',
		component: 'Input',
	},
	 {
		label: '拼包车编号',
		field: 'carpoolBusNo',
		component: 'Input',
	}, */
	{
		label: '支付方式',
		field: 'payType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "pay_type"
		},
		required: true
	},
	/* {
		label: '支付单号',
		field: 'payNo',
		component: 'Input',
	}, */
	{
		label: '订单金额',
		field: 'orderPrice',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true },
				{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!' },
			];
		},
	},
	{
		label: '结算价',
		field: 'settlementPrice',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true },
				{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!' },
			];
		},
	},
	{
		label: '待收款',
		field: 'unpaidPrice',
		component: 'InputNumber',
		required: true,
	},
];


//子表列表数据
export const coupleActivityCarpoolBusAndLeaderColumns : BasicColumn[] = [
	{
		title: '领队',
		align: "center",
		dataIndex: 'leaderId_dictText',
		customRender: ({ record, column }) => {
			return record ? record.leaderId : record
		}
	},
	{
		title: '绑定状态',
		align: "center",
		dataIndex: 'arrangeaStatus_dictText'

	},
	{
		title: '是否合并',
		align: "center",
		dataIndex: 'toPickUppointId',
		customRender: ({ record, column }) => {
			return record ? '已合并到其它上车点' : '否'
		}

	},
	{
		title: '上车点人数',
		align: "center",
		dataIndex: 'pickUppointUserNum'

	},
	{
		title: '车辆',
		align: "center",
		dataIndex: 'carIds_dictText',
		customRender: ({ record, column }) => {
			return record ? record.carIds : record
		}
	},
	{
		title: '上车点',
		align: "center",
		dataIndex: 'addressId_dictText'
	},
	{
		title: '选择人',
		align: "center",
		dataIndex: 'userId_dictText',
		customRender: ({ record, column }) => {
			return record ? record.userId : record
		}
	},
	{
		title: '是否用户发起',
		align: "center",
		dataIndex: 'isUser_dictText'
	},
	{
		title: '说明',
		align: "center",
		dataIndex: 'msg'
	},
];
//子表表单数据
export const coupleActivityCarpoolBusAndLeaderFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
	{
		label: '选择领队',
		field: 'leaderId',
		component: 'JPopup',
		componentProps: ({ formActionType }) => {
			const { setFieldsValue } = formActionType;
			return {
				setFieldsValue: setFieldsValue,
				code: "select_leader",
				fieldConfig: [
					{ source: '电话', target: 'leaderId' },
				],
				multi: true
			}
		},
		required: true,
	},

	{
		label: '',
		field: 'carpoolBus',
		component: 'InputTextArea',
		ifShow: false
	},
	{
		label: '',
		field: 'upCarTimesJson',
		component: 'InputTextArea',
		ifShow: false
	},
	{
		label: '选择上车地点',
		field: 'addressId',
		component: 'ApiSelect',
		componentProps: ({ formActionType, formModel }) => {
			if (formModel.carpoolBus) {
				return {
					//multiple: 多选；不填写为单选
					mode: 'multiple',
					//请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }}
					api: () => defHttp.get({ url: '/couple-activity/activity/coupleActivityCarpoolBus/getPickUpPoints?carpoolBus=' + formModel.carpoolBus + '&getType=1' }),
					//数值转成String
					numberToString: false,
					//标题字段
					labelField: 'address',
					//值字段
					valueField: 'id',
					//请求参数
					params: {
						carpoolBus: formModel.carpoolBus
					},
					//返回结果字段
					resultField: 'records'
				}
			}

		},
	},

	{
		label: '选择车辆',
		field: 'carIds',
		component: 'JPopup',
		componentProps: ({ formActionType }) => {
			const { setFieldsValue } = formActionType;
			return {
				setFieldsValue: setFieldsValue,
				code: "scenic_spot_select_car_model",
				fieldConfig: [
					{ source: '车牌', target: 'carIds' },
				],
				multi: true
			}
		},
		required: true,
	},
	/* {
		label: '绑定状态',
		field: 'arrangeaStatus',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "arrangea_status"
		},
	}, */



	{
		label: '说明',
		field: 'msg',
		component: 'InputTextArea',
	},
];
export const cancelJuneryFormSchema : FormSchema[] = [
	{
		label: '取消原因',
		field: 'cancelCause',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "reasons_for_cancellation"
		},
		required: true,
	},

]

export const refundPriceSchema : FormSchema[] = [
	{
		label: '退款金额',
		field: 'price',
		component: 'InputNumber',
		required: true,
	},

]

export const combinedTravelSchema : FormSchema[] = [
	{
		label: '合并到',
		field: 'combinedTravelId',
		component: 'JPopup',
		componentProps: ({ formActionType }) => {
			const { setFieldsValue } = formActionType;
			return {
				setFieldsValue: setFieldsValue,
				code: "select_activity_journey",
				fieldConfig: [
					{ source: '标题', target: 'combinedTravelId' },
				],
				multi: true
			}
		},
		required: true,
	}

]

export const combinedPickupPointSchema : FormSchema[] = [
	{
		label: '合并到',
		field: 'toUpPointId',
		component: 'ApiSelect',
		componentProps: ({ formActionType, formModel }) => {
			if (formModel.carpoolBus) {
				return {
					//multiple: 多选；不填写为单选
					mode: 'multiple',
					//请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }}
					api: () => defHttp.get({ url: '/couple-activity/activity/coupleActivityCarpoolBus/getPickUpPoints?carpoolBus=' + formModel.carpoolBus + '&getType=2' }),
					//数值转成String
					numberToString: false,
					//标题字段
					labelField: 'address',
					//值字段
					valueField: 'carUpLeaderId',
					//请求参数
					params: {
						carpoolBus: formModel.carpoolBus
					},
					//返回结果字段
					resultField: 'records'
				}
			}

		},
	},
	{
		label: '',
		field: 'carpoolBus',
		component: 'InputTextArea',
		ifShow: false
	},
	{
		label: '',
		field: 'thisUpPointId',
		component: 'InputTextArea',
		ifShow: false
	},

]


export const bindCarUpdateModuleSchema : FormSchema[] = [
	{
		label: '选择车辆',
		field: 'carId',
		component: 'JPopup',
		componentProps: ({ formActionType }) => {
			const { setFieldsValue } = formActionType;
			return {
				setFieldsValue: setFieldsValue,
				code: "scenic_spot_select_car_model",
				fieldConfig: [
					{ source: '车牌', target: 'carId' },
				],
				multi: true
			}
		},
		required: true,
	}

]

export const cancelSendInfoSchema : FormSchema[] = [
	{
		label: '通知对象',
		field: 'notifyObj',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "info_notify_obj"
		},
		required: true,
	},
	{
		label: '消息分类',
		field: 'infoType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "sys_category,name,id,pid='1733823765838475265'"
		},
		required: true,
	},
	{
		label: '消息模板',
		field: 'messageTemplate',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "couple_message_template,info_title,id"
		},
		required: true,
	},
	{
		label: '通知方式',
		field: 'sendType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "info_send_type"
		},
		required: true,
	},
	{
		label: '系统消息内容',
		field: 'msg',
		component: 'InputTextArea',
		ifShow: ({ values }) => {
			return values.sendType == 3 || values.sendType == 4 || values.sendType == 5 || values.sendType == 6
		},
	},
	{
		label: '微信模板内容',
		field: 'wxMsg',
		component: 'InputTextArea',
		helpMessage: '填写方式：内容+,例如：张三,12月7号集合。不超过20个字',
		ifShow: ({ values }) => {
			return values.sendType == '1' || values.sendType == '4' || values.sendType == '5'
		},
	},
	{
		label: '短信变量内容',
		field: 'variantContent',
		component: 'Input',
		helpMessage: '填写方式：内容+,例如：张三,12月7号集合。不超过20个字',
		ifShow: ({ values }) => {
			return values.sendType == '4' || values.sendType == '2' || values.sendType == 6
		},
	},
	{
		label: '群二维码',
		field: 'qRCode',
		component: 'JUpload',
		helpMessage: '最多上传2张图片',
		componentProps: {
			fileType: UploadTypeEnum.image,
			maxCount: 2,
		},
		ifShow: ({ values }) => {
			return values.infoType == '1733823872122138625'
		},
		required: true,

	},
]

//子表列表数据
export const coupleActivityCarpoolBusUserAuditColumns : BasicColumn[] = [
	{
		title: '发起人',
		align: "center",
		dataIndex: 'userId_dictText'
	},
	{
		title: '审核状态',
		align: "center",
		dataIndex: 'auditStatus_dictText'
	},
	{
		title: '审核不通过原因',
		align: "center",
		dataIndex: 'auditFailTheMsg'
	},
	{
		title: '主表',
		align: "center",
		dataIndex: 'carpoolBus'
	},
];
//子表表单数据
export const coupleActivityCarpoolBusUserAuditFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
	{
		label: '发起人',
		field: 'userId',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "couple_user,user_name,id"
		},
	},
	{
		label: '审核状态',
		field: 'auditStatus',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "user_initiate_team_audit_status"
		},
	},
	{
		label: '审核不通过原因',
		field: 'auditFailTheMsg',
		component: 'Input',

	},
	{
		label: '主表',
		field: 'carpoolBus',
		component: 'Input',
	},
];
export const auditJuneryFormSchema : FormSchema[] = [
	{
		label: '审核状态',
		field: 'auditStatus',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "user_initiate_team_audit_status"
		},
	},
	{
		label: '不通过原因',
		field: 'auditFailTheMsg',
		component: 'InputTextArea',
		ifShow: ({ values }) => {
			return values.auditStatus == '-1'
		},
	},

]
//子表列表数据
export const coupleInformDetailColumns : BasicColumn[] = [
	{
		title: '内容',
		align: "center",
		dataIndex: 'msg'
	},
	{
		title: '类别',
		align: "center",
		dataIndex: 'infoType_dictText'
	},
	{
		title: '接收者',
		align: "center",
		dataIndex: 'receiverUserId_dictText'
	},
	{
		title: '接收者电话',
		align: "center",
		dataIndex: 'receiverUserPhone'
	},
	{
		title: '接收状态',
		align: "center",
		dataIndex: 'infoStatus_dictText'
	},
];
//子表表单数据
export const coupleInformDetailFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];

//子表列表数据
export const coupleCommentColumns : BasicColumn[] = [
	{
		title: '发布时间',
		align: "center",
		dataIndex: 'createTime'
	},
	{
		title: '用户',
		align: "center",
		dataIndex: 'userId'
	},
	{
		title: '回复哪条消息',
		align: "center",
		dataIndex: 'replyId'
	},
	{
		title: '图片',
		align: "center",
		dataIndex: 'img',
		customRender: render.renderImage,
	},
	{
		title: '文字',
		align: "center",
		dataIndex: 'content'
	},
	{
		title: '点赞数',
		align: "center",
		sorter: true,
		dataIndex: 'zanNum'
	},
	{
		title: '回复数',
		align: "center",
		sorter: true,
		dataIndex: 'repleNum'
	},
	{
		title: '是否置顶',
		align: "center",
		sorter: true,
		dataIndex: 'isTop_dictText'
	},
	{
		title: '是否推荐到游记',
		align: "center",
		sorter: true,
		dataIndex: 'isStrategy_dictText'
	},
	{
		title: '评论类别',
		align: "center",
		dataIndex: 'commentType_dictText'
	},
	{
		title: '租户',
		align: "center",
		dataIndex: 'tenantId_dictText'
	},
];
//子表表单数据
export const coupleCommentFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
	{
		label: '用户',
		field: 'userId',
		component: 'Input',
	},
	{
		label: '回复哪条消息',
		field: 'replyId',
		component: 'Input',
	},
	{
		label: '图片',
		field: 'img',
		component: 'JImageUpload',
		componentProps: {
		},
	},
	{
		label: '文字',
		field: 'content',
		component: 'Input',
	},
	{
		label: '是否置顶',
		field: 'isTop',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "couple_is"
		},
	},
	{
		label: '是否推荐到游记',
		field: 'isStrategy',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "couple_is"
		},
	},
];
//子表列表数据
export const coupleActivityCarpoolBusGradientPriceColumns : BasicColumn[] = [

	{
		title: '从多少人',
		align: "center",
		dataIndex: 'startUsers'
	},
	{
		title: '到多少人',
		align: "center",
		dataIndex: 'endUsers'
	},
	{
		title: '价格',
		align: "center",
		dataIndex: 'price'
	},
];
//子表表单数据
export const coupleActivityCarpoolBusGradientPriceFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
	{
		label: '从多少人',
		field: 'startUsers',
		component: 'InputNumber',
		required: true
	},
	{
		label: '到多少人',
		field: 'endUsers',
		component: 'InputNumber',
		required: true
	},
	{
		label: '价格',
		field: 'price',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: false },
				{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!' },
			];
		},
		required: true
	},
];